module.exports = (app) => {
  const { config } = app
  const { dict, constant } = config
  const { ORDER_STATE_AWAIT_PAY } = constant
  const { Schema, model, getModelName, formatDate } = app.jax.mongoose
  const modelName = getModelName(__filename)

  const agentSchema = new Schema({
    adminId: Schema.Types.ObjectId, // 管理员ID
    agentName: String, // 代理商名称
    mobile: String, // 手机号
    money: { type: Number, default: 0 }, // 余额
    totalMoney: { type: Number, default: 0 }, // 历史总余额
  })

  const AgentModel = model(modelName, agentSchema)

  return AgentModel
}
